export default {
  // 异步,action中放异步操作,之后根据异步回调的情况,分别去调commit(mutations),实际state的值是在mutations中进行改变
  // changeCity: function (cxt, city) {
  //  cxt.commit('changeCity', city)
  // }

  changeCity ({ commit }, city) {
    commit('changeCity', city)
  },
  // ES6新语法,对象解构 参考地址: http://es6.ruanyifeng.com/?search=+%E5%8F%82%E6%95%B0%E8%A7%A3%E6%9E%84&x=9&y=2#docs/destructuring
  changeCity1 ({ commit, state }, city) {
    commit('changeCity', city)
    console.log(state.city)
  }
}
